package com.archerdu.base.dao;

public class TreeNodeUtil {
    
    /**
     * 预编辑TreeNode接口实现类
     * @param entity
     * @param parent
     */
    public static void preEdit(TreeNode<?, ?> entity, TreeNode<?, ?> parent) {
        String code = "";
        int lev = 0;
        if (null != parent) {
            code = parent.getCode() + parent.getId();
            lev = parent.getLev() + 1;
        }

        entity.setCode(code);
        entity.setLev(lev);
    }
}
